<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生连接客户端</title>
</head>
<body>
    <div style="height: 200px; width: 100%" id="event">
121212
    </div>

</body>
<script type="text/javascript" src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
    let source = new EventSource("/event")
    source.onmessage = function (ret) {
        console.log(ret);
        document.getElementById("event").innerText = ret.data;
        // $('#event').innerText = ret.data;
    }
</script>
</html>
